package gui.Teacher;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.Rectangle;
import javax.swing.*;
import javax.swing.border.TitledBorder;

import control.TerminateExamcontrol;

import System.MainControl;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Font;
import java.awt.SystemColor;

public class TerminateExam extends JPanel implements ActionListener {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4317191202420470995L;

	public JButton btnBack; 
	
	private JTextField textField;
	private JTextField txtPleaseEnterThe;
	private TerminateExamcontrol control;
	
	public TerminateExam() {
	    super();
	    control = new TerminateExamcontrol();
	    setBackground(SystemColor.activeCaption);
		initialize();
}


private void initialize() {
	
	this.setSize(500, 500);
	this.setLayout(null);
	setBorder(new TitledBorder(null, "Terminated Exam", TitledBorder.LEADING, TitledBorder.TOP, null, null));
	JLabel lblExamId = new JLabel("Exam ID");
	lblExamId.setFont(new Font("Tahoma", Font.PLAIN, 14));
	lblExamId.setHorizontalAlignment(SwingConstants.CENTER);
	lblExamId.setBounds(102, 94, 69, 22);
	add(lblExamId);
	
	textField = new JTextField();
	textField.setBounds(181, 97, 86, 20);
	add(textField);
	textField.setColumns(10);
	
	JButton btnValidate = new JButton("Validate");
	btnValidate.setFont(MainControl.MainPanelFont);
	btnValidate.addActionListener(this);
	btnValidate.setBounds(323, 96, 89, 23);
	add(btnValidate);
	
	JButton btnTerminate = new JButton("Terminate");
	btnTerminate.setFont(MainControl.MainPanelFont);
	btnTerminate.addActionListener(this);
	btnTerminate.setBounds(102, 280, 125, 23);
	add(btnTerminate);
	
	btnBack = new JButton("Back");
	btnBack.addActionListener(this);
	btnBack.setFont(MainControl.MainPanelFont);
	btnBack.setBounds(281, 280, 89, 23);
	add(btnBack);	
	
	txtPleaseEnterThe = new JTextField();
	txtPleaseEnterThe.setFont(new Font("Microsoft New Tai Lue", Font.BOLD, 13));
	txtPleaseEnterThe.setText("Please Enter the Exam ID:");
	txtPleaseEnterThe.setBounds(34, 45, 165, 20);
	add(txtPleaseEnterThe);
	txtPleaseEnterThe.setColumns(10);
}


@Override			
public void actionPerformed(ActionEvent e) 
{
	if(e.getSource() == btnBack)
	{
		MainControl.setGUI(MainControl.currentUser.getRole(), this);
	}
}
}

